package model;

/**
 * Team EBE
 * 
 * RelationshipImpl.java represents the relationship between two given classes
 * in a UML diagram; Maintains a source class, a destination class, and their
 * multiplicities
 * 
 */
public class RelationshipImpl {
	private int srcMin, srcMax, destMin, destMax;
	private AnchorPoint src, dest;
	String type;
	int srcReletiveToDest;

	public RelationshipImpl(AnchorPoint srcIn, AnchorPoint destIn) {
		srcMin = srcMax = destMin = destMax = 0;
		this.src = srcIn;
		this.dest = destIn;
	}
	
	// Src multiplicity
	public int getSrcMin() {
		return srcMin;
	}

	public void setSrcMin(int srcMin) {
		this.srcMin = srcMin;
	}

	public int getSrcMax() {
		return srcMax;
	}

	public void setSrcMax(int srcMax) {
		this.srcMax = srcMax;
	}

	// Dest multiplicity
	public int getDestMin() {
		return destMin;
	}

	public void setDestMin(int destMin) {
		this.destMin = destMin;
	}

	public int getDestMax() {
		return destMax;
	}

	public void setDestMax(int destMax) {
		this.destMax = destMax;
	}

	public AnchorPoint getSrc() {
		return src;
	}

	public void setSrc(AnchorPoint src) {
		this.src = src;
	}

	public AnchorPoint getDest() {
		return dest;
	}

	public void setDest(AnchorPoint dest) {
		this.dest = dest;
	}

	public String saveString() {
		String s = "<relationship>\n";
		s += "<src>\n<name>" + src.getName() + "</name>\n<id>" + src.getId()
				+ "</id>\n</src>\n<dest>\n<name>" + dest.getName()
				+ "</name>\n<id>" + dest.getId() + "</id>\n</dest>\n<type>"
				+ type + "\n</relationship>\n";
		return s;

	}
	public String getType() {
		
		return this.type;
	}
	public void setType(String typeIn) {
		this.type = typeIn;
		
	}

}
